package com.wing.sell.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wing.sell.model.entity.Order;
import com.wing.sell.model.response.OrderSkuDetailSearchVo;
import com.wing.sell.model.response.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 销售订单表-Dao
 *
 * @author
 */
@Mapper
public interface OrderDao extends BaseMapper<Order> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<OrderVO> list4app(@Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<OrderVO> list4app(@Param("page") Page<OrderVO> page, @Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    OrderVO get4appById(Long id);


    /**
     * 查询订单详情
     *
     * @param id
     * @return
     */
    OrderVO getDetailById(@Param("id") Long id);

    /**
     * 查询订单中物料的信息
     * @param orderId
     * @param warehouseId
     * @return
     */
    List<OrderSkuDetailSearchVo> listByInfo(@Param("orderId") Long orderId,@Param("warehouseId") Long warehouseId);

    /**
     * 查询订单的物料详情
     * @param orderId
     * @return
     */
    List<OrderSkuDetailSearchVo> listByInfoBySku(@Param("orderId") Long orderId);
}
